"""

@author: jiangpj
@email: pj.jiang@hzgosun.com
@file: macManagePage.py
@time: 2019/5/10 11:32

MAC数据清洗的增删改查自动化测试

"""
from src.common.poium import Page
from src.common.vue.button import VueButton
from src.common.vue.element import VueElements
from src.common.vue.float_window import FloatWindow
from src.common.vue.label import ElementBaseLabel
from src.common.vue.label import ElementType as ET
from src.common.vue.search import VueSearch
from src.common.vue.table import VueTurnPage, VueTable


class SearchTools(VueSearch):
    start_time = ElementBaseLabel(ET.DATE_PICKER, "时间")
    end_time = ElementBaseLabel(ET.DATE_PICKER, "时间", date_picker_index=1)
    facility = ElementBaseLabel(ET.DROPDOWN_LIST, label="设备")
    bound = ElementBaseLabel(ET.DROPDOWN_LIST, label="绑定")
    search_btn = VueButton("检索")  # 查询按钮
    reset_btn = VueButton("全部绑定")

    def __init__(self):
        super(SearchTools, self).__init__()


class Table(VueTable):
    """人口表"""
    checkbox = VueElements(class_name='ivu-checkbox-input', index=0)
    re_btn = VueButton("批量绑定")

    def __init__(self):
        super(Table, self).__init__()


class AddMacManageWindow(FloatWindow):
    """弹窗"""
    plot_input = VueElements(class_name='ivu-select-input', index=0)
    plot = ElementBaseLabel(ET.DROPDOWN_LIST, label="小区")

    def __init__(self, title=None, index=None):
        super(AddMacManageWindow, self).__init__(title=title, index=index)


class MacManagePage(Page):
    turnPage = VueTurnPage()   # 翻页
    searchTools = SearchTools()  # 查询区域
    table = Table()  # 列表
    addwin = AddMacManageWindow(title="绑定")    # 弹窗
